// 将wx.request转成promise对象

function wxToPromise(method, options = {}){
    return new Promise((resolve, reject) => {
        options.success = resolve
        options.fail = err => {
            reject(err)
        }
        wx[method](options)
    })
}


export {
    wxToPromise
}